#include <vector>
#include <iostream>

using namespace std;

template <typename T>
class Stack{
public:
  vector<T> numbers;
  int size;
  Stack() {
    size = 0;
    numbers = {};  
    cout << "A Stack is created." << endl;
  }
  void push(T n) {
    ++size;
    numbers.push_back(n);
  }
  void pop() {
    if (numbers.empty() == false) {
      --size;
      numbers.pop_back();
    }
  }
  T top() {
    if (numbers.empty() == true) {
      return 0;
    } else {
      return *(numbers.end() - 1);
    }
  }
};
